package com.company.genealogy.web.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 家族活动Mapper
 */
@Mapper
public interface FamilyEventMapper {

    /**
     * 获取即将到来的活动
     */
    @Select("SELECT id, title, description, event_date, event_time, location, " +
            "max_participants, current_participants, status " +
            "FROM family_event " +
            "WHERE event_date >= CURDATE() AND status = 'upcoming' " +
            "ORDER BY event_date ASC, event_time ASC " +
            "LIMIT #{limit}")
    List<Map<String, Object>> getUpcomingEvents(@Param("limit") int limit);
} 